package com.zhangxun.mapper;

import com.zhangxun.domain.Sku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhangxun.domain.SkuChange;
import org.apache.ibatis.annotations.Update;

/**
* @author 张循
* @description 针对表【sku(单品SKU表)】的数据库操作Mapper
* @createDate 2023-01-03 17:24:00
* @Entity com.zhangxun.domain.Sku
*/
public interface SkuMapper extends BaseMapper<Sku> {

    @Update("update sku set actual_stocks = actual_stocks+#{count} where sku_id = #{skuId} and actual_stocks+#{count} >= 0")
    void updateCountById(SkuChange skuChange);
}




